UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PF5SK6tsmDeWcEa5UbfbLAY7BAFMdr7JN4w/UT5Ep5Q='
WHERE
key_id = 'eb7005b34df8b134ee51faf19b5f428d8ac7d7863844df81e11da73b62b7ebde'
AND (
token = 'PF5SK6tsmDeWcEa5UbfbLAY7BAFMdr7JN4w/UT5Ep5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)