UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uwx+SepttznD5EQ851QdBJvC3UIepW4ppiyl9qJUiAc=' 
WHERE 
  key_id = 'e0dad663d1051bc7afc1f5e7e68320ab8d0237285db5f4da083a65412307a859' 
  AND (
    token = 'Uwx+SepttznD5EQ851QdBJvC3UIepW4ppiyl9qJUiAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016