UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ebysoVwqwBqVMentSdz7fS03hNAmP5J9oOzKO7dlKT4='
WHERE
key_id = '08322838ba3d6d7238be5e2b4c1bce34e9b664e25a337e51886b2b4ce0f04261'
AND (
token = 'ebysoVwqwBqVMentSdz7fS03hNAmP5J9oOzKO7dlKT4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)