UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jj2yOiZ4XtNpTGH3r5c76XBS/u49vYoUp0Euae4VumY=' 
WHERE 
  key_id = 'f06e695a74194671daf741bc3ef3e40d255a3e17ea9768cc463b1e4651555fed' 
  AND (
    token = 'jj2yOiZ4XtNpTGH3r5c76XBS/u49vYoUp0Euae4VumY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046