UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+hBX2USf7jryPm03a0+/NjchzosKzi0QR3v4gIQ7xaI='
WHERE
key_id = '3407dd53e9ba20017e7155c9e94d3aae40e1dbfe46b3dfd551c7a4b0940a84dc'
AND (
token = '+hBX2USf7jryPm03a0+/NjchzosKzi0QR3v4gIQ7xaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)