UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TLAvyy+S7TKpVhh1QC8HUkZH4TlWW5pFCONgeC/boBQ=' 
WHERE 
  key_id = '71878702d4014c1f4f12c2f6c4ba09060c22f0d01abd7509f01ccb56dc54e0b1' 
  AND (
    token = 'TLAvyy+S7TKpVhh1QC8HUkZH4TlWW5pFCONgeC/boBQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031