UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PYNZSO+ems3ak1NV5cdo7V6kqkoabKAFB6ZII8m1qhw=' 
WHERE 
  key_id = '569cea772b26f95afbf8933d4944c764bdec6725bbf606525e1548a37a69a11a' 
  AND (
    token = 'PYNZSO+ems3ak1NV5cdo7V6kqkoabKAFB6ZII8m1qhw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037