UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PROrr/5lZxmwHZ6P5cKh7I+IuyZHPkGIpni3TVRXoSw='
WHERE
key_id = '5a62c9d789a6fd896511111fe9d8fbf7eaf277b09c1988173aaedac59962f3ad'
AND (
token = 'PROrr/5lZxmwHZ6P5cKh7I+IuyZHPkGIpni3TVRXoSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)