UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '658DZraOFXa8zW0aLdcoJ6bEfhSFQXhZwBMM8wsiP8w='
WHERE
key_id = '25bb90b704793354be4907ebd0b98e2db45104652857dedaa7f63cab54ec878d'
AND (
token = '658DZraOFXa8zW0aLdcoJ6bEfhSFQXhZwBMM8wsiP8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)