UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tNfwYBsmNhyWmixzY052rlsnpIRjN0UIr6H9OVI1kT4='
WHERE
key_id = '15d81e7103ed5634ba6d4ec597a1f6f9459a6c0bb464d445cf838072df22f17e'
AND (
token = 'tNfwYBsmNhyWmixzY052rlsnpIRjN0UIr6H9OVI1kT4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)