UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'opqV2CKR20hvVLxr73zgRApC7BKfFN5zPsj7r8d/kDs='
WHERE
key_id = '71907c3f7093350fa45d9853a5a79a3a4bbcc30f39567b2783b2de0e083f70dc'
AND (
token = 'opqV2CKR20hvVLxr73zgRApC7BKfFN5zPsj7r8d/kDs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)