UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gpCr4gxQRHqAigS8RGkePUM/AHKLyK3+x51HWlBzitg='
WHERE
key_id = 'b53ba1d009cd98a568c89bfddabeddf97178cd2345f13d1e309c62d175f94d8d'
AND (
token = 'gpCr4gxQRHqAigS8RGkePUM/AHKLyK3+x51HWlBzitg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)