UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4VZ2sqK2s+Hh6cR/8xZjTLIN8Jvel5945lGonGILdpI='
WHERE
key_id = '3c7c64dc4f2cb7e1e91bbb1555bb21b8bc63af40b161dea083fb304412d0aec4'
AND (
token = '4VZ2sqK2s+Hh6cR/8xZjTLIN8Jvel5945lGonGILdpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)