UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ii2d0Ounh/bqKyZfrYE7dajEZo7VjgHKOHPYJ6LYdzs=' 
WHERE 
  key_id = 'f93efee461827e410b9207bea1569453c4cd8cdeda3f43bd052146795b2bd7aa' 
  AND (
    token = 'ii2d0Ounh/bqKyZfrYE7dajEZo7VjgHKOHPYJ6LYdzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033