UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dg26RhxsWfnJBeuGU73fbI6TCmkaXFOu9pAdJ9fe37k='
WHERE
key_id = 'c2bd1d5e1e79c3f265c0e63270ac6cb0cf77a4cea0c6615ef9d6b77b4435e5e0'
AND (
token = 'Dg26RhxsWfnJBeuGU73fbI6TCmkaXFOu9pAdJ9fe37k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)