UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J5ZW57Jl8mAB6F6VpkNvq35rv4nflMbrd2zYmfytpuI='
WHERE
key_id = '19c6837b8dfa8131e2b091e47abf9efeb98d1f2255f577cd92126290b68a8d81'
AND (
token = 'J5ZW57Jl8mAB6F6VpkNvq35rv4nflMbrd2zYmfytpuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)