UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZZ1ulqNxKcIjI3p8DGiw/cBSFcWm7rF5UVQeZzsJje4=' 
WHERE 
  key_id = '536d6597354c71958543a1c4455b34cfc241ce6591b67e8cd6bbee8e76c58642' 
  AND (
    token = 'ZZ1ulqNxKcIjI3p8DGiw/cBSFcWm7rF5UVQeZzsJje4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063