UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G/OEXTdwb6KOxg9wzL+iK64RpYNjwivncfT0ILPPp9c='
WHERE
key_id = 'b8d307509c7ef2cca0c70089de27513c6af79a69924d7e13d2c374ad4adcce4f'
AND (
token = 'G/OEXTdwb6KOxg9wzL+iK64RpYNjwivncfT0ILPPp9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)