UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 've2LWv/5Gpi1oaDK3Q02sp7huCKmTSYsafU5N9HznXk=' 
WHERE 
  key_id = 'a385449b261c1d0b3f668464827446d8e90d090ff63d4f021ac924bb73acd8c8' 
  AND (
    token = 've2LWv/5Gpi1oaDK3Q02sp7huCKmTSYsafU5N9HznXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021