UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'quBW1hwGDuQzM/6AFr+klUfR1q/VTHkLLk/f2YHdxyw='
WHERE
key_id = '133fa88c91b1e4b13b0fcc5d806eae19f6e3c2a4e1e067787dbe551096267496'
AND (
token = 'quBW1hwGDuQzM/6AFr+klUfR1q/VTHkLLk/f2YHdxyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)