UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W3CEpvgwnbjd72xmtFJd/qjeu6Kep0nIDrzwypzNqcM=' 
WHERE 
  key_id = '79999a34938ca36f8797ffedc2bfe1b942b43a5239481d99eecd2d4215e1e0cb' 
  AND (
    token = 'W3CEpvgwnbjd72xmtFJd/qjeu6Kep0nIDrzwypzNqcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032