UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+TG5Wjzo6lpQPTtnrjAtn7+riw0hBZLqP7OgcpxXEWw=' 
WHERE 
  key_id = '7d8f4b4dc448de86892691c5f3539739fe3bf208cf9dfcede0d1bc86abdf2426' 
  AND (
    token = '+TG5Wjzo6lpQPTtnrjAtn7+riw0hBZLqP7OgcpxXEWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040