UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+GfbnfPNEpYlE3ENiL0oME6gicrcGv7R1678COCvO98='
WHERE
key_id = '55922783df25058c1809922fc3870f9bddc4b24490d21b9e37db9d2de5971d46'
AND (
token = '+GfbnfPNEpYlE3ENiL0oME6gicrcGv7R1678COCvO98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)