UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't05koyS8dL9MgTRygJByiGHLnK+abL1z0hpJZXr7/e0='
WHERE
key_id = '2c142a3c70b953fc25c342f611a6b51dcef210881528c03b3783bb4419e22e3b'
AND (
token = 't05koyS8dL9MgTRygJByiGHLnK+abL1z0hpJZXr7/e0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)