UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MqGDFewRxdzyWEswIvO61rXZDRtvviJurwmHJf2jAy0='
WHERE
key_id = '361c00f8b7594d1c31c471a4d64c5587511b22364149db9bbbd520cfadc6c028'
AND (
token = 'MqGDFewRxdzyWEswIvO61rXZDRtvviJurwmHJf2jAy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)