UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2EpvQfWUojxCNTvFNqhE/HO6nj3WyzvL2h0URL9LF0k='
WHERE
key_id = 'c161c1841f23c706f5dc49faa5c2f77e5256c6ef67117b192758f2e33f081dd6'
AND (
token = '2EpvQfWUojxCNTvFNqhE/HO6nj3WyzvL2h0URL9LF0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)