UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+PB28lKBTozj44t7PKLb0D2ukZiN2GKKgW4ef8uCAnM=' 
WHERE 
  key_id = '262fdb286cbd85305f3de06e66d8b45ab4dfa30cde6e2da4455b18cfbb10d7d0' 
  AND (
    token = '+PB28lKBTozj44t7PKLb0D2ukZiN2GKKgW4ef8uCAnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028