UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ZcWawacqsvKzh/dy4tveU+dyMtKrYgYtDjF5jR+2GM='
WHERE
key_id = '78b423741e4781fdab1a9590665dced34ce74fc69bbb48e2a981f410208a1153'
AND (
token = '5ZcWawacqsvKzh/dy4tveU+dyMtKrYgYtDjF5jR+2GM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)