UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3k7wJ3rbE4xaToUA1kr5tq26exWkZD/v/WnlSdgG/uM=' 
WHERE 
  key_id = '4c8279d05fccf07ce7521141e90cf847d8af63d53e781852a67e0661141d3fec' 
  AND (
    token = '3k7wJ3rbE4xaToUA1kr5tq26exWkZD/v/WnlSdgG/uM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030