UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CMyicHBqgnSqr5J2YH1V7ByM7SNeVpp2IcTJIA8/6x4=' 
WHERE 
  key_id = '8d086a8ad24c2076c7d35350913636c37d1b42bb89f2bad01aa0a2807e031afa' 
  AND (
    token = 'CMyicHBqgnSqr5J2YH1V7ByM7SNeVpp2IcTJIA8/6x4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041