UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u3gica8OEu4Dn2QshFj7w52+7HoNbXa9RY8yR9eMK+s='
WHERE
key_id = '32919b699bea6ec4d08d8b619d74f0e8e3fb233eb1c7d18655140587a3dd1cc6'
AND (
token = 'u3gica8OEu4Dn2QshFj7w52+7HoNbXa9RY8yR9eMK+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)