UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VE1hrip1TmSKgKV4LiwmJh0Tk+BG/uCqqB9JqAhzj1E='
WHERE
key_id = '458b727606323008743db0fd5c694354e03307d1f9e24f1cbb14c7babee9c3fb'
AND (
token = 'VE1hrip1TmSKgKV4LiwmJh0Tk+BG/uCqqB9JqAhzj1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)