UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9WXv14cixWODR1mapUFZzQwWepNVsazNYzqE3s3Gi6E='
WHERE
key_id = '27497b5cd8895d9371db7ab9c88823e69c07f8779b93ac0ab80f965cda630d27'
AND (
token = '9WXv14cixWODR1mapUFZzQwWepNVsazNYzqE3s3Gi6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)