UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1qwA+pMvNoYNTOMvJMr3nt2nz7UJA8GbIN02jfbWMSo='
WHERE
key_id = '4a5a3785817cb0b8368b7df93dc3720e57259d9eca406e692941a277a8baa314'
AND (
token = '1qwA+pMvNoYNTOMvJMr3nt2nz7UJA8GbIN02jfbWMSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)