UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNsXn3luvTu1SZTCe1haCmbwO8W8/eAjSVsP7MFiXLA=' 
WHERE 
  key_id = 'd832237ce32f60833c220a85dde6376f7998202d7175d0893272440078d1211a' 
  AND (
    token = 'xNsXn3luvTu1SZTCe1haCmbwO8W8/eAjSVsP7MFiXLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030