UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8TRo43Hvf9d+YTbUraY22CHQbyo9xcfccZyhPY69IMw='
WHERE
key_id = 'fba9fb5a3130e17cbcc3678e81aa9a79576f5ff5ba51dadd50673243e8b58284'
AND (
token = '8TRo43Hvf9d+YTbUraY22CHQbyo9xcfccZyhPY69IMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)