UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fzEIXM0kow8kaJ0hCPZzr0s22mEAdPAoWRHZJsTpiQQ='
WHERE
key_id = '6a14969a482caa39104c70ca9292dfb51a539f46d3d0f25efa5ac0383c53bdc2'
AND (
token = 'fzEIXM0kow8kaJ0hCPZzr0s22mEAdPAoWRHZJsTpiQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)