UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eWWr3QBNPsqkx2VorYhM9KSrK8bodi1AnE7W9W4GwHQ='
WHERE
key_id = '67b761945607e04292370d7754123e28a882f36ab8294e98c0b51712427f5bde'
AND (
token = 'eWWr3QBNPsqkx2VorYhM9KSrK8bodi1AnE7W9W4GwHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)