UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1719oyEhJAqtmeCS1jLbufH4OqiX+76OkG28OO8rJuI=' 
WHERE 
  key_id = 'c42ba6a233062d82d849a6eff6a03f3603dd48c871a5a9fe5961a74ee98defab' 
  AND (
    token = '1719oyEhJAqtmeCS1jLbufH4OqiX+76OkG28OO8rJuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028