UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jm1KE1EFVNnE+wrxLVEjsvFx2iIe9oqB6YOe6QpsgO0=' 
WHERE 
  key_id = '44830a7436d9cd85560577477fdc8b9bc3e031c4d6c6e003f45b3c0d13218a3d' 
  AND (
    token = 'jm1KE1EFVNnE+wrxLVEjsvFx2iIe9oqB6YOe6QpsgO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028