UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nxLpkVroLcbajn6EETrc6GHhrPcy7AxiMmVtRwzM7Ek='
WHERE
key_id = '38eb15383d0b13016dab99f742a34da9c2f7b7de568a239de4cd8d68e298ace0'
AND (
token = 'nxLpkVroLcbajn6EETrc6GHhrPcy7AxiMmVtRwzM7Ek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)